<?php require __DIR__.'/menu.conf.php'?>
<!-- Main Sidebar Container -->
<aside class="main-sidebar sidebar-dark-primary elevation-4">
    <!-- Brand Logo -->
    <a href="" class="brand-link">
        <!--                <img src="/addons/jiayou_vip/icon.jpg" alt="AdminLTE Logo" class="brand-image img-circle elevation-3"-->
        <!--                     style="opacity: .8">-->
        <span class="brand-text font-weight-light">留言板小程序控制台</span>
    </a>

    <!-- Sidebar -->
    <div class="sidebar">
        <!-- Sidebar user panel (optional) -->
        <!--<div class="user-panel mt-3 pb-3 mb-3 d-flex">-->
        <!--</div>-->
        <!-- Sidebar Menu -->
        <nav class="mt-2">
            <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
                <!-- Add icons to the links using the .nav-icon class
                     with font-awesome or any other icon font library -->
                <?php $re_path=Yii::$app->request->getPathInfo();?>
                <?php foreach($menu_config as $top_key=>$top):?>
                <?php if(($top_key=='mall' OR $top_key=='slide') AND Yii::$app->user->identity['type']!='admin'){continue;}?>
                    <li class="nav-item has-treeview <?php if(($re_path!='') AND $top_key==explode('-',explode('/',$re_path)[1])[0]){echo 'menu-open';}?>">
                        <a href="#" class="nav-link <?php if(($re_path!='') AND $top_key==explode('-',explode('/',$re_path)[1])[0]){echo 'active';}?>">
                            <i class="nav-icon fa fa-th"></i>
                            <p>
                                <?=$top['title']?>
                                <i class="right fa fa-angle-left"></i>
                            </p>
                        </a>
                        <ul class="nav nav-treeview">
                            <?php if(isset($top['child'])):?>
                                <?php foreach($top['child'] as $sun_key=>$sun):?>
                                    <li class="nav-item">
                                        <a href="/index.php/<?=$sun['link']?>" class="nav-link <?php if(($re_path!='') AND $sun['link']==$re_path){echo 'active';}?>">
                                            <i class="fa fa-circle-o nav-icon"></i>
                                            <p><?=$sun['title']?></p>
                                        </a>
                                    </li>
                                <?php endforeach;?>
                            <?php endif;?>
                        </ul>
                    </li>
                <?php endforeach;?>
            </ul>
        </nav>
        <!-- /.sidebar-menu -->
    </div>
    <!-- /.sidebar -->
</aside>
<?php $test=Yii::$app->request->getPathInfo();?>
